package com.lebang.feign;

import com.lebang.model.RequestUserInfo;
import com.lebang.model.back.Result;
import com.lebang.feign.fallback.SleepEarnedFallback;
import com.lebangweb.response.JsonData;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author xwj
 */
@FeignClient(name = "wangzhuan-earns", contextId = "wangzhuan-earns-sleep", fallback = SleepEarnedFallback.class)
public interface SleepEarnedFeign {
    /**
     * 获取睡觉赚数据--app
     *
     * @return 返回结果
     */
    @ApiOperation("获取睡觉赚数据")
    @PostMapping("/sleep/info")
    JsonData info(@RequestBody RequestUserInfo request);

    /**
     * 开始睡觉--app
     *
     * @return 返回结果
     */
    @ApiOperation("开始睡觉")
    @PostMapping("/sleep/star")
    JsonData star(@RequestBody RequestUserInfo request);

    /**
     * 用户唤醒--app
     *
     * @return 操作结果
     */
    @ApiOperation("用户唤醒")
    @PostMapping("/sleep/end")
    JsonData end(@RequestBody RequestUserInfo request, @RequestParam(value = "id", required = false) Integer id);

    /**
     * 领取金币--app
     *
     * @return 返回结果
     */
    @ApiOperation("领取金币")
    @PostMapping("/sleep/rise")
    Result<Integer> rise(@RequestBody RequestUserInfo request, @RequestParam(value = "id", required = false) Integer id);


}
